<template>
    <div class="basis-info"  style="width: 100%;">
        <Form ref="formData" :model="formData" :label-width="120">
            <Row>
                <Col  :xs="24" :md="12" :lg="8" :xl="6">
                    <FormItem label="付款方式">
                        <Select v-model="formData.sourceType" disabled>
                            <Option v-for="item in dataDict.receiptSourceTypeDict" :value="item.value"
                                    :key="item.value" :label="item.title">
                                {{ item.title }}
                            </Option>
                        </Select>
                    </FormItem>
                </Col>
                <Col :xs="24" :md="12" :lg="8" :xl="6">
                    <FormItem label="合同号" >
                        <Input type="text" v-model="formData.contractNo" disabled/>
                    </FormItem>
                </Col>
                <Col :xs="24" :md="12" :lg="8" :xl="6">
                    <FormItem label="收款日期" >
                        <DatePicker type="date" format="yyyy-MM-dd HH:mm:ss"
                                    placeholder="请选择"
                                    v-model="formData.succeedTime" disabled></DatePicker>
                    </FormItem>
                </Col>
                <Col :xs="24" :md="12" :lg="8" :xl="6">
                    <FormItem label="收款金额" >
                       <!-- <Input type="text" v-model="formData.arriveAmt" disabled/>-->
                     <RuiNumber type="currency" v-model="formData.arriveAmt" disabled/>
                    </FormItem>
                </Col>
                <Col :xs="24" :md="12" :lg="8" :xl="6">
                    <FormItem label="摘要" >
                        <Input type="text" v-model="formData.summary" disabled/>
                    </FormItem>
                </Col>
            <!--    <Col :xs="24" :md="12" :lg="8" :xl="6">
                    <FormItem label="状态" >
                        <Select v-model="formData.receiptStatus" disabled>
                            <Option v-for="item in dataDict.receiptStatusDict" :value="item.value"
                                    :key="item.value" :label="item.title">
                                {{ item.title }}
                            </Option>
                        </Select>
                    </FormItem>
                </Col>-->
                <Button type="primary" size="small" @click="detail">分配明细</Button>
            </Row>
        </Form>
        <div v-if="detailModel">
            <Modal v-model="detailModel" :title="detailTitle" :width="1000" :closable="false"
                   :mask-closable="false">
                <ChangeDetailTable
                    :spinShow="spinShow"
                    :isSP="isSP"
                    :Obj="Obj"
                    :loading="loading"
                    :dataDict="dataDict"
                    @closeSpin="closeSpin"
                    @showSpin="showSpin"
                />
                <div slot="footer">
                    <Button size="small" @click="detailModel = false">返回</Button>
                </div>
            </Modal>
        </div>
    </div>
</template>
<script>
    import {getTitleFromDataDict} from "_p/basic/assets/contract/js/utils";
    import ChangeDetailTable from "./ChangeDetailTable";
    export default {
        components: {
            ChangeDetailTable
        },
        props: {
            dataDict: {
                type: Object,
                required: true
            },
            Obj: {
                type: Object,
                required: true
            },
            formData: {
                type: Object,
                required: true
            }
        },
        data() {
            return {
                isSP: false,
                loading: false,
                spinShow: false,
                detailModel: false,
                detailTitle: "",
            };
        },
        mounted() {

        },
        methods: {
            // 分配明细
            detail() {
                this.detailModel = true;
            },
            showSpin() {
                this.spinShow = true;
            },
            closeSpin() {
                this.spinShow = false;
            },
            getTitle(type, val) {
                let data = this.dataDict[type + "Dict"] || [];
                return getTitleFromDataDict(data, val);
            }
        }
    };
</script>

<style scoped>
    .basis-info>>>.ivu-input[disabled]{
        color: black;
    }
    .basis-info>>>.ivu-select-disabled .ivu-select-selected-value{
        color:#515a6e;
    }
    .basis-info>>>.ivu-input-number-input[disabled]{
        color:black;
    }
</style>
